/* This file wraps ESource class */

%module "evolution"
%{
#include <libedataserver/e-source.h>	
%}

struct ESource 
{
};

%extend ESource
{
		ESource (const char* n, const char* uri, gboolean relative=1) {
   			if (relative)
				return e_source_new(n, uri);			
            else
			    return e_source_new_with_absolute_uri(n, uri);	        
		}

		ESource* dup (){
			return e_source_copy(self);
		}

		bool __eq__(ESource* src) {
			return e_source_equal(self,src);
		}
};

DEFINE_DEFAULT_DESTRUCTOR(ESource);
PROPERTY_RW(ESource, readonly, gboolean, e_source_get_readonly, e_source_set_readonly)
PROPERTY_RW(ESource, name, const char*, e_source_peek_name, e_source_set_name)
PROPERTY_RW(ESource, relative_uri, const char*, e_source_peek_relative_uri, e_source_set_relative_uri)
PROPERTY_RW(ESource, absolute_uri, const char*, e_source_peek_absolute_uri, e_source_set_absolute_uri)
PROPERTY_RW(ESource, group, ESourceGroup*, e_source_peek_group, e_source_set_group)
PROPERTY_READ(ESource, uid, const char*, e_source_peek_uid)
PROPERTY_READ(ESource, uri, const char*, e_source_get_uri)


